﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace FinalTestMachine.Motion.Process.RunModel
{
    /// <summary>
    /// 站位基础功能控制：是否使用SN;是否上传MES...
    /// </summary>
    public abstract class StationSelectFunsBase
    {

        public StationSelectFunsBase(string name, WorkMode workMode)
        {
            this.Name = name;
            this.Mode = workMode;
        }

        /// <summary>
        /// 当前模式的名字
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// 当前工作模式
        /// </summary>
        public WorkMode Mode { get; }

        /// <summary>
        /// 是否使用SN
        /// </summary>
        /// <returns></returns>
        public abstract bool Fun_IsUseSN();

        /// <summary>
        /// 是否上传MES
        /// </summary>
        /// <returns></returns>
        public abstract bool Fun_IsUseMES();



        public abstract bool Fun_IsUseNgBox();








        public virtual Brush GetBrush()
        {
            return Brushes.Transparent;

        }

        public List<KeyValuePair<string, bool>> GetFunsSettings()
        {
            List<KeyValuePair<string, bool>> pairs = new List<KeyValuePair<string, bool>>();

            pairs.Add(new KeyValuePair<string, bool>("是否使用SN", Fun_IsUseSN()));
            pairs.Add(new KeyValuePair<string, bool>("是否上传MES", Fun_IsUseMES()));
            pairs.Add(new KeyValuePair<string, bool>("是否使用NG料盒", Fun_IsUseNgBox()));
            return pairs;
        }

    }

    /// <summary>
    /// 工作模式
    /// </summary>
    public enum WorkMode
    {
        /// <summary>
        /// 正常工作模式
        /// </summary>
        Normal = 0,

        /// <summary>
        /// 空跑模式
        /// </summary>
        TestRun = 1,

        /// <summary>
        /// 线体模式
        /// </summary>
        AutoLine = 2,

        /// <summary>
        /// 点检模式
        /// </summary>
        SpotInspection = 3,

        /// <summary>
        /// 治具点检模式
        /// </summary>
        SocketSpotInspection = 4

    }
}
